#ifndef __ANDROID_NATIVE_HINT_H__
#define __ANDROID_NATIVE_HINT_H__


h_aio.aio_cancel(int fildes, struct aiocb * aiocbp)











/*
# Android framework cmd
	src:frameworks/native/cmds
	atrace
	bugreport
	bugreportz
	cmd
	dumpstate
	dumpsys
	ip-up-vpn
	lshal
	rawbu
	service
	servicemanager
	surfacereplayer
	frameworks\native\libs

# Android system cmd
adb
logcat

# Android vendor cmd
	sample_aenc 					
	sample_ai						 
	sample_ai_aenc					 
	sample_ai_ao					 
	sample_ca_descrambler			 
	sample_ca_ifcp					 
	sample_ca_klad					 
	sample_ca_pvr					 
	sample_ca_pvr_play				 
	sample_cc						 
	sample_cgms 					 
	sample_checkkeybox				 
	sample_cipher					 
	sample_complex_sci				 
	sample_demux_rec_alldata		 
	sample_demux_record 			 
	sample_dvb_cast 				 
	sample_dvb_pip					 
	sample_dvb_transcode			 
	sample_dvbplay					 
	sample_dvbplay_ir				 
	sample_dvbplay_pid				 
	sample_e2prom					 
	sample_encryptHdcpKey			 
	sample_esplay					 
	sample_fb						 
	sample_fs						 
	sample_gpio 					 
	sample_hdmi_tsplay				 
	sample_ifcp 					 
	sample_iframe_dec				 
	sample_ion						 
	sample_ipcfg					 
	sample_ipplay					 
	sample_karaoke					 
	sample_keybox					 
	sample_keyled					 
	sample_keymaster_provision		 
	sample_log						 
	sample_mixengine				 
	sample_otp_get_fuse 			 
	sample_otp_getcustomerkey		 
	sample_otp_gethdcprootkeylockflag
	sample_otp_getstbprivatedata	 
	sample_otp_getstbrootkeylockflag 
	sample_otp_lockhdcprootkey		 
	sample_otp_lockstbrootkey		 
	sample_otp_set_fuse 			 
	sample_otp_setcustomerkey		 
	sample_otp_sethdcprootkey		 
	sample_otp_setstbprivatedata	 
	sample_otp_setstbrootkey		 
	sample_playreadypk_provision

	*/

## liblog:
	src:system/core/liblog
	hdr:system/core/liblog/include
	usage:
	LOCAL_LDLIBS += ?llog
	#include <android/log.h>


/*
libcutils
	src:system/core/libcutils
	hdr:system/core/libcutils/include/cutils
	usage:
#include <cutils/log.h>
ALOGV
ALOGD
ALOGI
ALOGW
ALOGE
#include <cutils/log.h>


#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "mytest"
ALOGI("This is a test log using ALOGI");
ALOGD("This is a test log using ALOGD");
ALOGD_IF(con, "this is a test using log ALOGD_IF");
*/

/*	
libutils
	src:system/core/libutils
	hdr:system/core/libutils
	usage:
	 #define LOG_TAG "kris_ril"
    #include <utils/Log.h>
    
    然后使用LOGI，LOGD，LOGV，LOGW，LOGE来输出log信息，例如：
    
    LOGI("Rocky:requestRadioPower=%d/n",onOff);
*/
 class RWLock {
public:
    enum {
        PRIVATE = 0,
        SHARED = 1
    };

                RWLock();
    explicit    RWLock(const char* name);
    explicit    RWLock(int type, const char* name = NULL);
                ~RWLock();

    status_t    readLock();
    status_t    tryReadLock();
    status_t    writeLock();
    status_t    tryWriteLock();
    void        unlock();

    class AutoRLock {
    public:
        inline explicit AutoRLock(RWLock& rwlock) : mLock(rwlock)  { mLock.readLock(); }
        inline ~AutoRLock() { mLock.unlock(); }
    private:
        RWLock& mLock;
    };

    class AutoWLock {
    public:
        inline explicit AutoWLock(RWLock& rwlock) : mLock(rwlock)  { mLock.writeLock(); }
        inline ~AutoWLock() { mLock.unlock(); }
    private:
        RWLock& mLock;
    };
};   


template<typename T> 
class List 
{

}

/*
libbinder
	src:S:\android-8.0.0_r4\frameworks\native\libs\binder
	hdr:
	usage:

libinput
	src:S:\android-8.0.0_r4\frameworks\native\libs\input
	hdr:
	usage:

	
libselinux
	src:
	hdr:
	usage:

libcrypto
	src:
	hdr:
	usage:

libui
	src:
	hdr:
	usage:

libhardware_legacy
	src:
	hdr:
	usage:
libnativehelper
	src:libnativehelper
	hdr:libnativehelper/include/nativehelper/
	usage: JNI接口依赖 jni.h JNIHelp.h







	
*/
/********************************************************************************
                                global definition
********************************************************************************/

/********************************************************************************
                                <ctuils/log.h>
********************************************************************************/
// The locale header is useful for setting location specific information.
// Variables:
// struct lconv
// Macros:
// NULL
// LC_ALL
// LC_COLLATE
// LC_CTYPE
// LC_MONETARY
// LC_NUMERIC
// LC_TIME

#define LC_ALL        //设置下面的所有选项。
#define LC_COLLATE    //影响 strcoll 和 strxfrm 函数。
#define LC_CTYPE      //影响所有字符函数。
#define LC_MONETARY   //影响 localeconv 函数提供的货币信息。
#define LC_NUMERIC    //影响 localeconv 函数提供的小数点格式化和信息。
#define LC_TIME       //影响 strftime 函数。



// Functions:
// localeconv();
// setlocale();
// 2.6.1 Variables and Definitions
// The lconv structure contains the following variables in any order. The use of this structure is described
// in 2.6.3 localeconv.
// char *decimal_point;
// char *thousands_sep;
// char *grouping;
// char *int_curr_symbol;
// char *currency_symbol;
// char *mon_decimal_point;
// char *mon_thousands_sep;
// char *mon_grouping;
// char *positive_sign;
// char *negative_sign;
// char int_frac_digits;
// char frac_digits;
// char p_cs_precedes;
// char p_sep_by_space;
// char n_cs_precedes;
// char n_sep_by_space;
// char p_sign_posn;
// char n_sign_posn;
// The LC_ macros are described in 2.6.2 setlocale. NULL is the value of a null pointer constant.
typedef struct {
   char *decimal_point;
   char *thousands_sep;
   char *grouping;    
   char *int_curr_symbol;
   char *currency_symbol;
   char *mon_decimal_point;
   char *mon_thousands_sep;
   char *mon_grouping;
   char *positive_sign;
   char *negative_sign;
   char int_frac_digits;
   char frac_digits;
   char p_cs_precedes;
   char p_sep_by_space;
   char n_cs_precedes;
   char n_sep_by_space;
   char p_sign_posn;
   char n_sign_posn;
} lconv;



// Sets or reads location dependent information.
// category can be one of the following:
// LC_ALL Set everything.
// LC_COLLATE Affects strcoll and strxfrm functions.
// LC_CTYPE Affects all character functions.
// LC_MONETARY Affects the monetary information provided by localeconv function.
// LC_NUMERIC Affects decimal-point formatting and the information provided by function. localeconv
// LC_TIME Affects the strftime function.
// A value of "C" for locale sets the locale to the normal C translation environment settings (default). A
// null value ("") sets the native environment settings. A null pointer (NULL) causes setlocale to return a
// pointer to the string associated with this category for the current settings (no changes occur). All other
// values are implementation-specific.
// After a successful set, setlocale returns a pointer to a string which represents the previous location
// setting. On failure it returns NULL.
/*
Example:
#include<locale.h>
#include<stdio.h>
int main(void)
{
    char *old_locale;
    old_locale=setlocale(LC_ALL,"C");
    printf("The preivous setting was %s.\n",old_locale);
    return 0;
}*/
char *setlocale(int category, const char *locale);


struct lconv *localeconv(void);
/*
Sets the structure lconv to represent the current location settings.
The string pointers in the structure may point to a null string ("") which indicates that the value is not
available. The char types are nonnegative numbers. If the value is CHAR_MAX, then the value is not
available.
lconv variables:
char *decimal_point Decimal point character used for non-monetary values.
char *thousands_sep Thousands place separator character used for non-monetary values.
char *grouping
A string that indicates the size of each group of digits in nonmonetary quantities. Each character represents an integer value
which designates the number of digits in the current group. A value
of 0 means that the previous value is to be used for the rest of the
groups.
char *int_curr_symbol
A string of the international currency symbols used. The first three
characters are those specified by ISO 4217:1987 and the fourth is
the character which separates the currency symbol from the
monetary quantity.
char *currency_symbol The local symbol used for currency.

char *mon_decimal_point The decimal point character used for monetary values.
char *mon_thousands_sep The thousands place grouping character used for monetary values.
char *mon_grouping
A string whose elements define the size of the grouping of digits in
monetary values. Each character represents an integer value which
designates the number of digits in the current group. A value of 0
means that the previous value is to be used for the rest of the groups.
char *positive_sign The character used for positive monetary values.
char *negative_sign The character used for negative monetary values.
char int_frac_digits Number of digits to show after the decimal point in international
monetary values.
char frac_digits Number of digits to show after the decimal point in monetary values.
char p_cs_precedes
If equal to 1, then the currency_symbol appears before a
positive monetary value. If equal to 0, then the
currency_symbol appears after a positive monetary value.
char p_sep_by_space
If equal to 1, then the currency_symbol is separated by a space
from a positive monetary value. If equal to 0, then there is no space
between the currency_symbol and a positive monetary value.
char n_cs_precedes
If equal to 1, then the currency_symbol precedes a negative
monetary value. If equal to 0, then the currency_symbol
succeeds a negative monetary value.
char n_sep_by_space
If equal to 1, then the currency_symbol is separated by a space
from a negative monetary value. If equal to 0, then there is no space
between the currency_symbol and a negative monetary value.
char p_sign_posn Represents the position of the positive_sign in a positive
monetary value.
char n_sign_posn Represents the position of the negative_sign in a negative
monetary value.
The following values are used for p_sign_posn and n_sign_posn:
0 Parentheses encapsulate the value and the currency_symbol.
1 The sign precedes the value and currency_symbol.
2 The sign succeeds the value and currency_symbol.
3 The sign immediately precedes the value and currency_symbol.
4 The sign immediately succeeds the value and currency_symbol.
*/

/*
Example:
#include<locale.h>
#include<stdio.h>
int main(void)
{
    struct lconv locale_structure;
    struct lconv *locale_ptr=&locale_structure;
    locale_ptr=lcoaleconv();
    printf("Decimal point: %s",locale_ptr->decimal_point);
    printf("Thousands Separator: %s",locale_ptr->thousands_sep);
    printf("Grouping: %s",locale_ptr->grouping);
    printf("International Currency Symbol: %s",locale_ptr->int_curr_symbol);
    printf("Currency Symbol: %s",locale_ptr->currency_symbol);
    printf("Monetary Decimal Point: %s",locale_ptr->mon_decimal_point);
    printf("Monetary Thousands Separator: %s",locale_ptr->mon_thousands_sep);
    printf("Monetary Grouping: %s",locale_ptr->mon_grouping);
    printf("Monetary Positive Sign: %s",locale_ptr->positive_sign);
    printf("Monetary Negative Sign: %s",locale_ptr->negative_sign);
    printf("Monetary Intl Decimal Digits: %c",locale_ptr->int_frac_digits);
    printf("Monetary Decimal Digits: %c",locale_ptr->frac_digits);
    printf("Monetary + Precedes: %c",locale_ptr->p_cs_precedes);
    printf("Monetary + Space: %c",locale_ptr->p_sep_by_space);
    printf("Monetary - Precedes: %c",locale_ptr->n_cs_precedes);
    printf("Monetary - Space: %c",locale_ptr->n_sep_by_space);
    printf("Monetary + Sign Posn: %c",locale_ptr->p_sign_posn);
    printf("Monetary - Sign Posn: %c",locale_ptr->n_sign_posn);
}
*/
class h_cutils_log:Base
{
	void ALOGI(const char* log);
	void ALOGD("This is a test log using ALOGD");
	void ALOGD_IF(con, "this is a test using log ALOGD_IF");
};
























#define NULL (void*)(0)
typedef long size_t;

class Base
{
public:
    const long NULL  = (void*)(0);

};


/********************************************************************************
                                <time.h>
********************************************************************************/
// The time header provides several functions useful for reading and converting the current time and date.
// Some functions behavior is defined by the LC_TIME category of the location setting.
// Macros:
// NULL
// CLOCKS_PER_SEC
// Variables:
// typedef size_t
// typedef clock_t
// typedef size_t
// struct tm

// Functions:
// asctime();
// clock();
// ctime();
// difftime();
// gmtime();
// localtime();
// mktime();
// strftime();
// time();


// CLOCKS_PER_SEC is the number of processor clocks per second.
#define CLOCKS_PER_SEC  (0)

// size_t is the unsigned integer result of the sizeof keyword.
//typedef long size_t;

// clock_t is a type suitable for storing the processor time.
typedef int clock_t; //类型标识


// time_t is a type suitable for storing the calendar time.
typedef int time_t; //类型标识

struct tm
{
    int tm_sec; /* seconds after the minute (0 to 61) */
    int tm_min; /* minutes after the hour (0 to 59) */
    int tm_hour; /* hours since midnight (0 to 23) */
    int tm_mday; /* day of the month (1 to 31) */
    int tm_mon; /* months since January (0 to 11) */
    int tm_year; /* years since 1900 */
    int tm_wday; /* days since Sunday (0 to 6 Sunday=0)*/
    int tm_yday; /* days since January 1 (0 to 365) */
    int tm_isdst; /* Daylight Savings Time */
};
// struct tm is a structure used to hold the time and date. Its members are as follows:
// int tm_sec; /* seconds after the minute (0 to 61) */
// int tm_min; /* minutes after the hour (0 to 59) */
// int tm_hour; /* hours since midnight (0 to 23) */
// int tm_mday; /* day of the month (1 to 31) */
// int tm_mon; /* months since January (0 to 11) */
// int tm_year; /* years since 1900 */
// int tm_wday; /* days since Sunday (0 to 6 Sunday=0)*/
// int tm_yday; /* days since January 1 (0 to 365) */
// int tm_isdst; /* Daylight Savings Time */
// If tm_isdst is zero, then Daylight Savings Time is not in effect. If it is a positive value, then Daylight
// Savings Time is in effect. If it is negative, then the function using it is requested to attempt to calculate
// whether or not Daylight Savings Time is in effect for the given time.
// Note that tm_sec may go as high as 61 to allow for up to two leap seconds.


// Returns a pointer to a string which represents the day and time of the structure timeptr. The string is in
// the following format:
// DDD MMM dd hh:mm:ss YYYY
// DDD Day of the week (Sun, Mon, Tue, Wed, Thu, Fri, Sat)
// MMM Month of the year (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
// dd Day of the month (1,...,31)
// hh Hour (0,...,23)
// mm Minute (0,...,59)
// ss Second (0,...,59)
// YYYY Year

// The string is terminated with a newline character and a null character. The string is always 26 characters
// long (including the terminating newline and null characters).
// A pointer to the string is returned.
/*
Example:
#include<time.h>
#include<stdio.h>
int main(void)
{
    time_t timer;
    timer=time(NULL);
    printf("The current time is %s.\n",asctime(localtime
    (&timer)));
    return 0;
}*/
char *asctime(const struct tm *timeptr);



// Returns the processor clock time used since the beginning of an implementation-defined era (normally
// the beginning of the program). The returned value divided by CLOCKS_PER_SEC results in the number
// of seconds. If the value is unavailable, then -1 is returned.
clock_t clock(void);
/*
Example:
#include<time.h>
#include<stdio.h>
int main(void)
{
    clock_t ticks1, ticks2;
    ticks1=clock();
    ticks2=ticks1;
    while((ticks2/CLOCKS_PER_SEC-ticks1/CLOCKS_PER_SEC)<1)
    ticks2=clock();
    printf("Took %ld ticks to wait one second.\n",ticks2-ticks1);
    printf("This value should be the same as CLOCKS_PER_SEC which is %ld.\n",CLOCKS_PER_SEC);
    return 0;
}*/


// Returns a string representing the localtime based on the argument timer. This is equivalent to:
// asctime(locatime(timer));
// The returned string is in the following format:
// DDD MMM dd hh:mm:ss YYYY
// DDD Day of the week (Sun, Mon, Tue, Wed, Thu, Fri, Sat)
// MMM Month of the year (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
// dd Day of the month (1,...,31)
// hh Hour (0,...,23)
// mm Minute (0,...,59)
// ss Second (0,...,59)
// YYYY Year
// The string is terminated with a newline character and a null character. The string is always 26 characters
// long (including the terminating newline and null characters).
// A pointer to the string is returned.
char *ctime(const time_t *timer);

// Calculates the difference of seconds between time1 and time2 (time1-time2).
// Returns the number of seconds.
double difftime(time_t time1, time_t time2);

// The value of timer is broken up into the structure tm and expressed in Coordinated Universal Time
// (UTC) also known as Greenwich Mean Time (GMT).
// A pointer to the structure is returned. A null pointer is returned if UTC is not available.
struct tm *gmtime(const time_t *timer);

// The value of timer is broken up into the structure tm and expressed in the local time zone.
// A pointer to the structure is returned.
/*
Example:
#include<time.h>
#include<stdio.h>
int main(void)
{
    time_t timer;
    timer=time(NULL);
    printf("The current time is %s.\n",asctime(localtime
    (&timer)));
    return 0;
}*/
struct tm *localtime(const time_t *timer);


// Converts the structure pointed to by timeptr into a time_t value according to the local time zone. The
// values in the structure are not limited to their constraints. If they exceed their bounds, then they are
// adjusted accordingly so that they fit within their bounds. The original values of tm_wday (day of the
// week) and tm_yday (day of the year) are ignored, but are set correctly after the other values have been
// constrained. tm_mday (day of the month) is not corrected until after tm_mon and tm_year are
// corrected.
// After adjustment the structure still represents the same time.
// The encoded time_t value is returned. If the calendar time cannot be represented, then -1 is returned.
/*
Example:
#include<time.h>
#include<stdio.h>
//find out what day of the week is January 1, 2001(first day of the 21st century)
int main(void)
{
    struct tm time_struct;
    char days[7][4]={"Sun", "Mon", "Tue", "Wed", "Thu","Fri", "Sat"};
    time_struct.tm_year=2001-1900;
    time_struct.tm_mon=0;
    time_struct.tm_mday=1;
    time_struct.tm_sec=0;
    time_struct.tm_min=0;
    time_struct.tm_hour=0;
    time_struct.tm_isdst=-1;
    if(mktime(&time_struct)==-1)
    {
        printf("Error getting time.\n");
        exit(0);
    }
    printf("January 1, 2001 is a %s.\n",days[time_struct.tm_wday]);
    return 0;
}
*/
time_t mktime(struct tm *timeptr);



// Formats the time represented in the structure timeptr according to the formatting rules defined in format
// and stored into str. No more than maxsize characters are stored into str (including the terminating null
// character).
// All characters in the format string are copied to the str string, including the terminating null character,
// except for conversion characters. A conversion character begins with the % sign and is followed by
// another character which defines a special value that it is to be replaced by.
// Conversion
// Character What it is replaced by
// %a abbreviated weekday name
// %A full weekday name
// %b abbreviated month name
// %B full month name
// %c appropriate date and time representation
// %d day of the month (01-31)
// %H hour of the day (00-23)
// %I hour of the day (01-12)
// %j day of the year (001-366)
// %m month of the year (01-12)
// %M minute of the hour (00-59)
// %p AM/PM designator
// %S second of the minute (00-61)
// %U week number of the year where Sunday is the first day of week 1 (00-53)
// %w weekday where Sunday is day 0 (0-6)
// %W week number of the year where Monday is the first day of week 1 (00-53)
// %x appropriate date representation
// %X appropriate time representation
// %y year without century (00-99)
// %Y year with century
// %Z time zone (possibly abbreviated) or no characters if time zone isunavailable
// %% %
// Returns the number of characters stored into str not including the terminating null character. On error
// zero is returned.
size_t strftime(char *str, size_t maxsize, const char *format,const struct tm *timeptr);


// Calculates the current calender time and encodes it into time_t format.
// The time_t value is returned. If timer is not a null pointer, then the value is also stored into the object
// it points to. If the time is unavailable, then -1 is returned
time_t time(time_t *timer);

class h_time
{
public:
    const int CLOCKS_PER_SEC;

public:
    char *asctime(const struct tm *timeptr);
    clock_t clock(void);
    char *ctime(const time_t *timer);
    double difftime(time_t time1, time_t time2);
    struct tm *gmtime(const time_t *timer);
    struct tm *localtime(const time_t *timer);
    time_t mktime(struct tm *timeptr);
    size_t strftime(char *str, size_t maxsize, const char *format,const struct tm *timeptr);
    time_t time(time_t *timer);
};


#endif


//end of file
